package ${package}.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jjb.util.BaseController;
import com.jjb.util.Pager;
import ${package}.model.${className};
import ${package}.api.I${className}Service;

/**
* <p>Discription:[${info}视图层Controller]</p>
* Created on ${date}
* @author ${uname}
*/
@Controller
@RequestMapping("${classNameLower}")
public class ${className}Controller extends BaseController{

@Resource
private I${className}Service ${classNameLower}Service;

/**
* <p>Discription:[分页{info}集合数据接口]</p>
* Created on ${date}
* @param pager 分页数据
* @param ${classNameLower} 条件
* @author:${uname}
*/
@ResponseBody
@RequestMapping("selectPage")
public String selectPage(${className} ${classNameLower},Pager<${className}> pager){
if(pager==null){
pager = new Pager<${className}>();
}
pager = ${classNameLower}Service.selectPage(${classNameLower}, pager);
return null;
}

/**
* <p>Discription:[通过条件查询${info}接口]</p>
* Created on ${date}
* @param ${classNameLower} ${info}
* @author:${uname}
*/
@ResponseBody
@RequestMapping("selectOne")
public String selectOne(${className} ${classNameLower}){
${classNameLower} = ${classNameLower}Service.selectOneByCondition(${classNameLower});
return null;
}

/**
* <p>Discription:[通过ID编号查询${info}接口]</p>
* Created on ${date}
* @param id ID编号
* @author:${uname}
*/
@ResponseBody
@RequestMapping("selectById")
public String selectById(Integer id){
${className} ${classNameLower} = ${classNameLower}Service.selectById(id);
return null;
}

/**
* <p>Discription:[添加${info}接口]</p>
* Created on ${date}
* @param ${classNameLower} ${info}
* @author:${uname}
*/
@ResponseBody
@RequestMapping("insert")
public String insert(${className} ${classNameLower}){
${classNameLower} = ${classNameLower}Service.insert(${classNameLower});
return null;
}

/**
* <p>Discription:[修改${info}接口]</p>
* Created on ${date}
* @param ${classNameLower} ${info}
* @author:${uname}
*/
@ResponseBody
@RequestMapping("update")
public String update(${className} ${classNameLower}){
boolean key = ${classNameLower}Service.update(${classNameLower});
return null;
}

/**
* <p>Discription:[根据IDS批量删除${info}接口]</p>
* Created on ${date}
* @param ids ID编号数组
* @author:${uname}
*/
@ResponseBody
@RequestMapping("deleteByIds")
public String deleteByIds(String[] ids){
boolean key = ${classNameLower}Service.deleteByIds(ids);
return null;
}

/**
* <p>Discription:[删除${info}接口]</p>
* Created on ${date}
* @param id ID编号
* @author:${uname}
*/
@ResponseBody
@RequestMapping("deleteById")
public String deleteById(Integer id){
boolean key = ${classNameLower}Service.deleteById(id);
return null;
}
}